# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: George Rawlinson <george@rawlinson.net.nz>

pkgname=python-dotty-dict
_pkgname="${pkgname#python-}"
_name="${_pkgname/-/_}"
pkgver=1.3.1
pkgrel=3
pkgdesc="Dictionary wrapper for quick access to deeply nested keys"
arch=('any')
url="https://github.com/pawelzny/dotty_dict"
license=('MIT')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-poetry-core' 'python-wheel')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
b2sums=('fa8cfe2ca5f5902e84cff60997cb0808862f3d53289732a2ed613e8a988df5a2a77d729c1cdeb0414a0bb3b15049ee6af0c0025fed7e9930680c003c4d0d2523')

build() {
  cd "$_name-$pkgver"
  python -m build --wheel --no-isolation
}

check() {
  cd "$_name-$pkgver"
  pytest
}

package() {
  cd "$_name-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
